<?php
	include("ControlConn.php");
	if(!empty($_POST['open']))	//判断get的值有没有
	{
		echo $d = $_POST['open'];
		$sql = "update `user` set control = '开启'";		
		mysql_query($sql);
	} 
	if(!empty($_POST['close']))	//判断get的值有没有
	{
		echo $d = $_POST['close'];
		$sql = "update `user` set control = '关闭'";		
		mysql_query($sql);
	} 
	mysql_close();
?>

<html>
<head>
<title>点击改变按钮文字</title>
<meta http-equiv="content-Type" content="text/html;charset=gb2312">
</head>
<body>
<script language="JavaScript">
function hao() {
   if (document.form1.ok.value=="开启")
   {
     document.form1.ok.value="关闭";	 
   }
   else
   {
     document.form1.ok.value="开启";
   }
}
</script>
<form name="form1" method="post" action="index.php" >
<input name="open" type="submit" id="op" value="开启" >
<input name="close" type="submit" id="cl" value="关闭" >
</form>
</body>
</html>